import requests

url = "https://yunyan-test.frp.xxbu.cn/api/sasc-aggregation-property-web/login"
req_data = {
            "loginType": "0",
            "password": "12345678",
            "username": "125@qq.com",
            "userType": "0"}

resp = requests.post(url, json=req_data)
resp_dict = resp.json()
token = resp_dict["data"]["token"]
print(token)

url2 = "https://yunyan-test.frp.xxbu.cn/api/sasc-aggregation-property-web/enterprise/update"
req_data2 = {
            "address": "4id都ianb1打16628837181",
            "channel": "1",
            "contact": "333",
            "email": "125@qq.com",
            "enabled": "true",
            "expireTime": "4102329599",
            "gmtCreate": "1643075084",
            "id": "164307508400001",
            "maxCommunityAmount": "33",
            "mobile": "13759763920",
            "name": "2022125测试"}
req_hader = {"token": token}
resp2 = requests.post(url2, json=req_data2, headers=req_hader)
print(resp2.json())


url3 = "https://yunyan-test.frp.xxbu.cn/api/sasc-aggregation-property-web/house/query?pageSize=10&pageNum=1&query=community_id:eq:164506857300001;type:eq:;identifier:like:;state:eq:;or;house_name:like:%%;household_mobile:like:%%;household_name:like:%%"
resp3 = requests.get(url3, headers=req_hader)
print(resp3.json())
resp_dict2 = resp3.json()
numb = resp_dict2["data"]["list"][0]["id"]
print(numb)
